package generatedClasses;

import java.util.Map.*;
import java.util.HashMap;
import struts.*;
import struts.tools.*;

public class RessourceCreator
{
  protected static String nl;
  public static synchronized RessourceCreator create(String lineSeparator)
  {
    nl = lineSeparator;
    RessourceCreator result = new RessourceCreator();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "";
  protected final String TEXT_2 = "\t\t\t\t\t\t\t\t\t\t\t";
  protected final String TEXT_3 = "\t";
  protected final String TEXT_4 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
     HashMap<String,String> ressources = (HashMap<String,String>) argument;
    for(Entry<String,String> entry:ressources.entrySet()){
	String cle=entry.getKey();
	String value=entry.getValue();
    stringBuffer.append(TEXT_1);
    stringBuffer.append(cle+"="+value);
    stringBuffer.append("\n");
    stringBuffer.append(TEXT_2);
    }
    stringBuffer.append(TEXT_3);
    stringBuffer.append(TEXT_4);
    return stringBuffer.toString();
  }
}
